@page
@{ Layout = "_Layout"; }

<div style="height: 10px"></div>

<el-form size="mini" :inline="true">
  <el-form-item label="广告类型">
    <el-select v-model="advertisementType">
      <el-option v-for="type in types" :key="type" :label="type.value" :value="type.key"></el-option>
    </el-select>
  </el-form-item>
</el-form>

<el-table :data="advertisements">
  <el-table-column prop="advertisementName" label="广告名称" width="200"></el-table-column>
  <el-table-column prop="type" label="广告类型" width="80"></el-table-column>
  <el-table-column prop="display" label="广告显示"></el-table-column>
  <el-table-column prop="createdDate" label="添加日期" width="160"></el-table-column>
  <el-table-column label="操作" width="130">
    <template slot-scope="scope">
      <el-link
        :underline="false"
        style="margin-right: 5px;"
        v-on:click="btnEditClick(scope.row)"
        type="primary">
        编 辑
      </el-link>
      <el-link
        :underline="false"
        type="danger"
        v-on:click="btnDeleteClick(scope.row)">
        删 除
      </el-link>
    </template>
  </el-table-column>
</el-table>

<div style="height: 10px"></div>
<el-divider></el-divider>
<div style="height: 10px"></div>

<el-button
  size="small"
  type="primary"
  v-on:click="btnAddClick()">
  添加广告
</el-button>

@section Scripts{
  <script src="index.js" type="text/javascript"></script>
}